
const util = require('../../utils/util.js')
const app = getApp()
var cf = require('../../lib/config.js');
var c = require('../../lib/common.js');
var login = require('../../lib/login.js');
Page({
  data: {
    logs: [],
    head:null,
    username:null,
    hidden: true
  },
  onLoad: function () {
    var that=this;
    var userinfo=wx.getStorageSync('userinfo');
    console.log(userinfo);
    this.setData({ userinfo: userinfo});
  },
  getUserInfo: function (e) {
    login.login(e, this);
  },
  onShow:function(){
    var uid = wx.getStorageSync('userinfo').id;
    if (uid) {
      var jim = app.globalData.jimnew;
      var isLogin = jim.isLogin();
      var isInit = jim.isInit();
      console.log(isLogin);
      console.log(isInit);
      if (isLogin || isInit) {
        // this.getConversation();
      } else {
        login.iminit('imlogin', uid);
      }
    }
    c.loginVer(this);
  },
  jumpshequ:function(){
    console.log('jumpshequ');
    wx.navigateToMiniProgram({
      appId: 'wxbfff7aba15880236',
      path: 'pages/index/index',
      extraData: {
        foo: 'bar'
      },
      envVersion: 'release',
      success(res) {
        console.log(res);
      },
      fail(res){
       console.log(res);
      }
    })
  }
  
})
